<?php

namespace app\common\validate;
use think\Validate;

class Article extends Validate{
	
	protected $rule=[
		
		'title|文章标题'=>'require|unique:article',
		'tags|文章标签'=>'require',
		'cate_id|文章导航'=>'require',
		'desc|文章描述'=>'require',
		'content|文章内容'=>'require',
		'is_top|推荐'=>'require'
		
	];
	//添加文章
	public function sceneAdd(){
		return $this->only(['title','tags','cate','desc','content']);
	}
	//推荐操作
	public function sceneTop(){
		return $this->only(['is_top']);
	}
	//编辑
	//
	public function sceneEdit(){
		return $this->only(['title','tags','desc','content','cate_id']);
	}
	

}